import request from '@/utils/request'

// 查询商机列表
export function listOrder(query) {
  return request({
    url: '/crm/order/list',
    method: 'get',
    params: query
  })
}

// 查询商机详细
export function getOrder(orderId) {
  return request({
    url: '/crm/order/' + orderId,
    method: 'get'
  })
}

// 新增商机
export function addOrder(data) {
  return request({
    url: '/crm/order',
    method: 'post',
    data: data
  })
}

// 修改商机
export function updateOrder(data) {
  return request({
    url: '/crm/order',
    method: 'put',
    data: data
  })
}

// 删除商机
export function delOrder(orderId) {
  return request({
    url: '/crm/order/' + orderId,
    method: 'delete'
  })
}

// 获取全部商机
export function getCrmOrderAllNoPage(data) {
  return request({
    url: '/crm/order/getCrmOrderAllNoPage',
    method: 'post',
    data: data
  })
}


// 获取订单信息
export function getOrderOne(data) {
  return request({
    url: '/crm/order/getOrderOne',
    method: 'post',
    data: data
  })
}

// 查询我的订单列表
export function getOrderListAll(data) {
  return request({
    url: '/crm/order/getOrderListAll',
    method: 'post',
    data: data
  })
}

// 设置是否续费
export function setRenewal(data) {
  return request({
    url: '/crm/order/setRenewal',
    method: 'post',
    data: data
  })
}